﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="wfNegociacion.aspx.cs" Inherits="negociacion_wfNegociacion" %>
<%@ Register Src="../wuc/wuc_Header.ascx" TagName="wuc_Header" TagPrefix="uc1" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Negociación de Horas Hombre</title>
    <link rel="stylesheet" href="../styles/a-main/a-main.css" type="text/css"/>
    <link rel="stylesheet" href="../styles/div_tabs/DivTabstrip.css" type="text/css" />    
    
    <script language="javascript" src="../include/popcalendar.js"></script>
    <script language="javascript" src="../include/toolkit.js"></script>
    <script language="javascript" src="../include/fecha.js"></script>
    
    
    <script language="javascript">
    <!--
    var EstrucTrab;
    var ItemTrab;
    var DatosResumen;
    
    function DatosResumenInicializar() {
        var Datos = new Array(3);
        for(i=0;i<3;i++) {
            Datos[i] = new Array(6);
            for(j=0;j<6;j++) {
                Datos[i][j] = "_";
            }
        }
        return Datos;
    }
    
    function DatosResumenActualizar(positionV) {
        if(DatosResumen == null) {
            DatosResumen = DatosResumenInicializar();
        }
        if((positionV>0) && (positionV < 4)) {
            var _multConversorPorcent = 0.01;  
            var _nomControl = "";
            var _porcentAjuste = 1.00 - (parseFloat(document.getElementById('hidPorcentAjuste').value) * _multConversorPorcent);  
            
            _nomControl = "txtNPers" + positionV;             
            DatosResumen[positionV-1][0] = parseFloat(document.getElementById(_nomControl).value);
            
            _nomControl = "txtJornal" + positionV; 
            DatosResumen[positionV-1][1] = parseFloat(document.getElementById(_nomControl).value); 
            //Calculos
            DatosResumen[positionV-1][2] = DatosResumen[positionV-1][0] * DatosResumen[positionV-1][1];

            _nomControl = "lblTot" + positionV; 
            document.getElementById(_nomControl).innerHTML = DatosResumen[positionV-1][2];
            DatosResumen[positionV-1][3] = Redondear(DatosResumen[positionV-1][2] * _porcentAjuste,1);

            _nomControl = "lblAjust" + positionV; 
            document.getElementById(_nomControl).innerHTML = DatosResumen[positionV-1][3];
            
            //Hallar el programado por columna de HH Total
            if(EstrucTrab != null) {
            
            }
            else {
                //DatosResumen[positionV][4] = 0;
            }
            DatosResumen[positionV-1][4] = 0;
            _nomControl = "lblPrg" + positionV; 
            document.getElementById(_nomControl).innerHTML = DatosResumen[positionV-1][4];

            //Calcular Remanente
            DatosResumen[positionV-1][5] = DatosResumen[positionV-1][3] - DatosResumen[positionV-1][4];
            _nomControl = "lblRem" + positionV; 

            document.getElementById(_nomControl).innerHTML = DatosResumen[positionV-1][5];
        }
        else {
            alert("Error indice esta fuera del rango");
        }
    }
    
    function EstrucTrabInicializar() {
        var vals = new Array(1600); //40 aviones x 40 trabajos
        for(i=0;i<1600;i++) {
            vals[i] = new Array(5);
            for(j=0;j<5;j++) {
                vals[i][j] = "_";
            }
        }
        return vals;
    }
    
    function EstrucTrabPop() {
        if(EstrucTrab == null) {
            EstrucTrab = EstrucTrabInicializar();
        }
        alert(EstrucTrab);
    }
    
    function Test() {
        EstrucTrab = EstrucTrabInicializar();        
    }
    
    function makeActive(currentNode)
{
var str = "";
var listItem = currentNode.parentNode;
var tableNode = currentNode.parentNode.parentNode;
var i=0;
while(i < tableNode.childNodes.length)
{
 str = tableNode.childNodes[i].innerText;
 str = str.replace(/^\s+/, "");
 str = str.replace(/\s+$/, "");
 document.getElementById(str).style.display="none";
 //document.getElementById(str).className = 'DspNonePrintBlock';
 tableNode.childNodes[i].childNodes[0].className = "";
 if(tableNode.childNodes[i].childNodes[0].innerText == currentNode.innerText)
 { 
 tableNode.childNodes[i].className = "current";
 }
 else
 {
 tableNode.childNodes[i].className = "";
 }
 i++;
}
currentNode.className = 'current';
}

    
    -->
    </script>
    

</head>
<body>
    <form id="form1" runat="server">
    <div id="container">    
        <uc1:wuc_Header ID="Wuc_Header1" runat="server" />            
<table width="100%" border="0" cellpadding="0" cellspacing="0">  
    <tr>
        <td rowspan="1" style="width: 15%; height: 24px;" valign="top">
        </td>
        <td width="1%" style="height: 24px">
        </td>
        <td colspan="4" style="height: 24px">
            &nbsp;<input onclick="javascript:EstrucTrabPop();" id="Button1" type="button" value="button" /></td>
    </tr>
    <tr>
        <td rowspan="3" style="width: 15%" valign="top">
            <table width="100%">
                <tr>
                    <td>
                        <table cellpadding="0" cellspacing="2" width="100%">
                            <tr>
                                <td class="CptWFMain">
                                    Accesos Directos</td>
                            </tr>
                            <tr>
                                <td class="Menu">
                                <ul class="MenAccDirec">
                                <li><a href="../general/wfindex.aspx">Menu Principal</a></li>
                                <li><a href="../trabajo/wfPrgTrab.aspx">Programación de Trabajos</a></li>
                                <li><a href="../negociacion/wfNegociacion.aspx">Negociación</a></li>
                                <li><a href="../trabajo/wfRegInfTrab.aspx">Registro de Trabajos</a></li>
                                <li><a href="../Consultas/wfIndexConsultas.aspx">Consultas</a></li>
                                <li><a href="../Reportes/wfIndexRep.aspx">Reportes</a></li>
                                </ul>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 3px">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    <td width="1%"><img src="../styles/a-main/Bullet485.gif" border="0" /></td>
        <td colspan="4">
        <span class="sTit">Resumen de Programación</span></td>
    </tr>
    <tr>
        <td width="1%" valign="top">
        </td>
        <td colspan="4" valign="top">
        <table width="780" cellpadding="0" cellspacing="0">
        <tr>
        <td style="width: 72px"><span class="lblCaption">Área</span></td>
        <td style="width: 103px">
        <asp:DropDownList ID="ddlArea" runat="server" CssClass="sel" TabIndex="1">
        </asp:DropDownList></td>
        <td style="width: 22px"></td>
        <td style="width: 91px"><span class="lblCaption">Fecha de Vuelo:</span></td>
        <td style="width: 115px">
        <asp:TextBox ID="txtFecProg" onblur="valFecha(this)" ContentEditable="false" runat="server" Width="85px" CssClass="inTextData" TabIndex="2"></asp:TextBox>
            <img id="imgFecInfo" border="0" onclick="popUpCalendar(this, txtFecProg, 'dd/mm/yyyy')"
                src="../styles/cssmain/calendar.gif" /></td>
        <td>
            <asp:ImageButton ID="imgConsultaPrg" runat="server" ImageUrl="../styles/a-main/look.gif"
                OnClick="imgConsultaPrg_Click" ValidationGroup="a" /></td>
        <td></td>
        </tr>
            <tr>
                <td style="width: 72px">
                    &nbsp;</td>
                <td style="width: 103px">
                </td>
                <td style="width: 22px">
                </td>
                <td style="width: 91px">
                </td>
                <td style="width: 115px">
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
            <table width="780" cellpadding="0" cellspacing="0">
            <tr>
            <td align="center">
            <div id="divCalculador" style="display:none;" runat="server">
            
            <table border="1" cellpadding="0" cellspacing="0" width="75%" style="border-collapse: collapse">                 
                  <tr>
                      <td class="titGrid" rowspan="2">
                          Tipo HH</td>
                      <td class="titGrid" rowspan="2">
                          Nro<br />
                          Personas</td>
                      <td class="titGrid" rowspan="2">
                          Tiempo<br />
                          Trabajo</td>
                      <td class="titGrid" rowspan="2">
                      </td>
                      <td class="titGrid" colspan="3">
                          Horas Hombre</td>
                      <td class="titGrid" colspan="1">
                      </td>
                  </tr>
                  <tr>
                      <td class="titGrid">
                          Totales</td>
                      <td class="titGrid">Ajustadas<br />
                          <span>(<asp:Label ID="lblPTNP" runat="server"></asp:Label>%)<asp:HiddenField
                              ID="hidPorcentAjuste" runat="server" />
                              </span>
                      </td>
                      <td class="titGrid">Programadas</td>
                      <td class="titGrid">
                          Remanente</td>
                  </tr>
                  <tr>
                      <td style="height: 25px">
                          <span class="lblCaption">Avión y Motor</span></td>
                      <td style="height: 25px">
                          <asp:TextBox ID="txtNPers1" onKeyPress="return ValidaFormatNum(event);" onBlur="DatosResumenActualizar(1)" runat="server" MaxLength="3" Width="35px" CssClass="inTextData" TabIndex="3"></asp:TextBox></td>
                      <td style="height: 25px">
                          <asp:TextBox ID="txtJornal1"  onKeyPress="return ValidaFormatNum(event);" onBlur="DatosResumenActualizar(1)" runat="server" MaxLength="3" Width="35px" CssClass="inTextData"></asp:TextBox></td>
                      <td style="height: 25px">
                          =</td>
                      <td align="right" style="height: 25px">
                          <asp:Label ID="lblTot1" runat="server" CssClass="inLabelNegocia"></asp:Label></td>
                      <td align="right" style="height: 25px">
                          <asp:Label ID="lblAjust1" runat="server" EnableViewState="False" CssClass="inLabelNegocia">0.0</asp:Label></td>
                      <td align="right" style="height: 25px">
                          <asp:Label ID="lblPrg1" runat="server" EnableViewState="False" CssClass="inLabelNegocia">0.0</asp:Label></td>
                      <td align="right" style="height: 25px">
                          <asp:Label ID="lblRem1" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                  </tr>
                  <tr>
                      <td>
                          <span class="lblCaption">Avionico</span></td>
                      <td>
                          <asp:TextBox onKeyPress="return ValidaFormatNum(event);" onBlur="DatosResumenActualizar(2)" ID="txtNPers2" runat="server" MaxLength="3" Width="35px" CssClass="inTextData" TabIndex="4"></asp:TextBox></td>
                      <td>
                          <asp:TextBox ID="txtJornal2" onKeyPress="return ValidaFormatNum(event);" onBlur="DatosResumenActualizar(2)"  runat="server" MaxLength="3" Width="35px" CssClass="inTextData"></asp:TextBox></td>
                      <td>
                          =</td>
                      <td align="right">
                          <asp:Label ID="lblTot2" runat="server" CssClass="inLabelNegocia"></asp:Label></td>
                      <td align="right">
                          <asp:Label ID="lblAjust2" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                      <td align="right">
                          <asp:Label ID="lblPrg2" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                      <td align="right" >
                          <asp:Label ID="lblRem2" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                  </tr>
                  <tr>
                      <td>
                          <span class="lblCaption">Estructurista</span></td>
                      <td>
                          <asp:TextBox ID="txtNPers3"  onKeyPress="return ValidaFormatNum(event);" onBlur="DatosResumenActualizar(3)"  runat="server" MaxLength="3" Width="35px" CssClass="inTextData" TabIndex="5"></asp:TextBox></td>
                      <td>
                          <asp:TextBox ID="txtJornal3" onKeyPress="return ValidaFormatNum(event);" onBlur="DatosResumenActualizar(3)" runat="server" MaxLength="3" Width="35px" CssClass="inTextData" ></asp:TextBox></td>
                      <td>
                          =</td>
                      <td align="right">
                          <asp:Label ID="lblTot3" runat="server" CssClass="inLabelNegocia"></asp:Label></td>
                      <td align="right">
                          <asp:Label ID="lblAjust3" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                      <td align="right">
                          <asp:Label ID="lblPrg3" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                      <td align="right">
                          <asp:Label ID="lblRem3" runat="server" CssClass="inLabelNegocia">0.0</asp:Label></td>
                  </tr>
              </table>
            </div>
            </td>
            </tr>
            </table>
            </td>
    </tr>
    <tr>
        <td width="1%">
        </td>
        <td colspan="4">
        <div id="divTrab" style="display:none;" runat="server">        
        <table width="780" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="lblCaption" valign="top" width="10%">
                    </td>
                <td align="right" valign="top">
                          <asp:ImageButton ID="imgGrabar" runat="server" ImageUrl="../styles/a-main/bot_guardar_act.gif"
                              OnClick="imgGrabar_Click" ToolTip="Guardar Informe" />&nbsp;
                    <img src="../styles/a-main/bot_print_act.gif" onclick="javascript:PopUpReport();" />
                </td>
            </tr>
            <tr>
                <td class="lblCaption" valign="top" width="10%">
                </td>
                <td align="right" valign="top">
                </td>
            </tr>
          <tr>
           <td valign="top" colspan="2">
           <asp:Label ID="lblDisplayMenu" runat="server"></asp:Label>
          <span style="margin: 0px;width: 980;height:880;text-align: center;OVERFLOW-X: scroll; border-right: 5px inset; padding-right: 0px; border-top: 0px inset; padding-left: 0px; padding-bottom: 0px; border-left: 1px inset; padding-top: 0px; border-bottom: 0px inset;">
            
            <asp:Label ID="lblDisplayTrabajos" runat="server"></asp:Label>
          </span>
              </td>              
          <td>&nbsp;</td>
          </tr>          
            <tr>
                <td colspan="2" valign="top">
                    </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="2" valign="top">
                </td>
                <td>
                </td>
            </tr>
          </table>
        </div>
        <asp:HiddenField ID="hid_DataDetTrab" runat="server" />              
        </td>
    </tr>
</table>
</div>
    </form>
</body>
</html>
